const tcb = require('@cloudbase/node-sdk');
const app = tcb.init({
  env: "cgc-3gi1zfana3604dcc"
});
// 获取数据库的引用
const db = app.database();
const _ = db.command;
const user = db.collection('power');
let res = null;
exports.main = async (data, content) => {
  switch (data.methods) {
    case "getrightsList":
      res = await user.where({}).get();
      break;
    default:
      break;
  };
  return res;
}